package com.molin.setTest.hashSetTest;

import java.util.HashSet;
import java.util.Iterator;

public class hashSetTest {
    public static void main(String[] args) {

        HashSet<String> hashSet=new HashSet<>();
        hashSet.add("ab");
        hashSet.add("abc");
        hashSet.add("abcd");
        hashSet.add("abcdf");
        hashSet.add("abcdfg");
        hashSet.add("abcdfg");
        hashSet.add("abcdfg");
        Iterator iterator=hashSet.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
        System.out.println("======================");
        for (String s : hashSet) {
            System.out.println(s);
        }
    }
}
